const config = require('./config');
const LockSc = require('./LockSc');
const {ethers} = require("ethers");
let words = "deer funny trip dress siren crane build stomach thunder setup yellow audit"
let wallet = ethers.Wallet.fromPhrase(words);
let sc = new LockSc(config.nodeUrl, config.scAddr);
const test = async ()=> {


    let data =[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 226, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 142, 127, 187, 73, 244, 54, 208, 232, 165, 12, 2, 246, 49, 231, 41, 165, 122, 154, 10, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] ;
    await sc.sendCond(wallet, Buffer.from(data));
    //0xf28f764935db05c0cf366ce305c6ffb12c8fadedc71bcd75136dc909bbcd25ce
}

const test2 = async ()=> {
    let data1 = 12345678910;
    let data2 = "0x8e7fbb49f436d0e8a50c02f631e729a57a9a0aca";
    let data3 = Buffer.from("helloworld");
    await sc.encodePackData(wallet, data1, data2, data3);
}
const test3 = async ()=> {
    let data1 = 12345678910;
    let data2 = "0x8e7fbb49f436d0e8a50c02f631e729a57a9a0aca";
    let data3 = Buffer.from("helloworld");
    await sc.encodeUint(wallet,data1);
}
const main = async ()=> {
    //await test();
    //await test2();
    await test3();
}
main();

